package com.quan.weixin.rpc.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.quan.common.core.support.BaseService;
import com.quan.weixin.rpc.api.WeixinSubscribeService;
import com.quan.weixin.rpc.model.WeixinSubscribe;

@Service
public class WeixinSubscribeServiceImpl extends BaseService<WeixinSubscribe> implements WeixinSubscribeService {

	@Override
	public WeixinSubscribe loadSubscribe() {
		
		List<WeixinSubscribe> list = super.selectAll() ;
		if(null != list && !list.isEmpty()) {
			return list.get(0);
		} else {
			WeixinSubscribe subscribe = new WeixinSubscribe() ;
			subscribe.setReply("感谢你关注...");
			subscribe.setStatus(1);
			super.insertSelective(subscribe);
			return subscribe ;
		}
	}

}
